<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>JavaScript应用技巧集合 - sanshi - 博客园</title>
<meta name="keywords" content="Javascript,JavaScript应用技巧集合">
<meta name="description" content="前段时间我曾经对JavaScript中的应用技巧进行了收集和总结，形成了以下几篇文章。这里我将会对这些应用技巧进行集中描述，如果你觉得遗漏了一些好用的应用技巧，也请在留言中提出，我会及时更新到这篇文章中的。">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/sanshi/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/sanshi/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head><body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        
<!--done-->
<div id="home">
<div id="header">
	<div id="blogTitle">
	<a id="lnkBlogLogo" href="http://www.cnblogs.com/sanshi/"><img id="blogLogo" src="logo.gif" alt="返回主页"></a>			
		
<!--done-->
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/sanshi/">sanshi</a></h1>
<h2>Javascript, Ajax, jQuery, Extjs, Asp.net, C#</h2>



		
	</div><!--end: blogTitle 博客的标题和副标题 -->
</div><!--end: header 头部 -->

<div id="main">
	<div id="mainContent">
	<div class="forFlow">
		<div id="navigator">
			
<!--done-->
			<ul id="navList">
				<li></li>
				<li><a id="MyLinks1_SpaceLink" class="menu" href="http://space.cnblogs.com/">社区</a></li>
				<li><a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/sanshi/">首页</a></li>
				<li><a id="MyLinks1_NewPostLink" class="menu" href="http://www.cnblogs.com/sanshi/admin/EditPosts.aspx?opt=1">新随笔</a></li>
				<li><a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/%e4%b8%89%e7%94%9f%e7%9f%b3%e4%b8%8a">联系</a></li>
				<li><a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/sanshi/admin/EditPosts.aspx">管理</a></li>
				<li><a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/sanshi/rss">订阅</a>
				<a id="MyLinks1_XMLLink" class="aHeaderXML" href="http://www.cnblogs.com/sanshi/rss"><img src="rss.gif" alt="订阅" style="border-width: 0px;"></a></li>
			</ul>


			<div class="blogStats">
				
				
<!--done-->
随笔- 122&nbsp;
文章- 0&nbsp;
评论- 1336&nbsp;

				
			</div><!--end: blogStats -->
		</div><!--end: navigator 博客导航栏 -->
		
					
<!--done-->
<div id="topics">
	<div class="post">
		<h1 class="postTitle">
			<a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html">JavaScript应用技巧集合</a>
		</h1>
		<div class="clear"></div>
		<div class="postBody">
			 <br>
    <br>
    前段时间我曾经对JavaScript中的应用技巧进行了收集和总结，形成了以下几篇文章：
    <br>
    <ol>
        <li><a href="http://www.cnblogs.com/sanshi/archive/2009/05/12/1454900.html">JavaScript
            tips and tricks - 1</a></li>
        <li><a href="http://www.cnblogs.com/sanshi/archive/2009/05/13/1455893.html">JavaScript
            tips and tricks - 2</a></li>
        <li><a href="http://www.cnblogs.com/sanshi/archive/2009/05/14/1456784.html">JavaScript
            tips and tricks - 3</a></li>
        <li><a href="http://www.cnblogs.com/sanshi/archive/2009/05/15/1457617.html">JavaScript
            tips and tricks - 4</a></li>
        <li><a href="http://www.cnblogs.com/sanshi/archive/2009/05/18/1459404.html">JavaScript
            tips and tricks - 5</a></li>
    </ol>
    <br>
    这里我将会对这些应用技巧进行集中描述，如果你觉得遗漏了一些好用的应用技巧，也请在留言中提出，我会及时更新到这篇文章中的。
    <br>
    <br>
    <ol>
        <li><strong>转化为Boolean类型</strong><br>
            所有JavaScript中的值都能隐式的转化为Boolean类型，比如：
            <div class="syntaxhighlighter  jscript" id="highlighter_261498"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_261498_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_261498" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">0 == </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">1 == </code><code class="jscript keyword">true</code><code class="jscript plain">; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript string">''</code> <code class="jscript plain">== </code><code class="jscript keyword">false</code> <code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript keyword">null</code> <code class="jscript plain">== </code><code class="jscript keyword">false</code> <code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            但是这些值都不是Boolean类型。<br>
            因此当我们使用三个等于号进行比较时：
            <div class="syntaxhighlighter  jscript" id="highlighter_459109"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_459109_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_459109" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">0 === </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// false</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">1 === </code><code class="jscript keyword">true</code><code class="jscript plain">; </code><code class="jscript comments">// false</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript string">''</code> <code class="jscript plain">=== </code><code class="jscript keyword">false</code> <code class="jscript comments">// false</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript keyword">null</code> <code class="jscript plain">=== </code><code class="jscript keyword">false</code> <code class="jscript comments">// false</code></td></tr></tbody></table></div></div></div>
            现在的问题是如何将其他类型转化为Boolean类型：
            <div class="syntaxhighlighter  jscript" id="highlighter_833197"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_833197_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_833197" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">!!0 === </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">!!1 === </code><code class="jscript keyword">true</code><code class="jscript plain">; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">!!</code><code class="jscript string">''</code> <code class="jscript plain">=== </code><code class="jscript keyword">false</code> <code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">!!</code><code class="jscript keyword">null</code> <code class="jscript plain">=== </code><code class="jscript keyword">false</code> <code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>为参数赋初值</strong><br>
            JavaScript中没有重载的概念，但是JavaScript中函数的参数都是可选的，如果调用时少写了一个参数，将会被<em>undefined</em>所代替。
            <div class="syntaxhighlighter  jscript" id="highlighter_810658"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_810658_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_810658" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">plus(base, added) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">base + added;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">plus(2); </code><code class="jscript comments">// NaN</code></td></tr></tbody></table></div></div></div>
            在这个例子中，<em>plus(2)</em>和<em>plus(2, undefined)</em>是等价的，<em>2 + undefined</em>的结果是<em>NaN</em>。
            <br>
            现在的问题是，如果没有传递第二个参数，如何为它赋初值呢？
            <div class="syntaxhighlighter  jscript" id="highlighter_446925"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_446925_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_446925" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">plus(base, added) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">added = added || 1;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">base + added;</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">plus(2); </code><code class="jscript comments">// 3</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript plain">plus(2, 2); </code><code class="jscript comments">// 4</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
            有网友提到 plus(2, 0) = 3; 的确是这样的，看来这个地方还要做一些特殊处理： 
            <div class="syntaxhighlighter  jscript" id="highlighter_602284"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_602284_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_602284" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">plus(base, added) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">added = added || (added === 0 ? 0 : 1);</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">base + added;</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>阻止别人在Iframe中加载你的页面</strong><br>
            如果你的网站变得非常有人气的时候，就有很多网站想链接到你的网站，甚至想把你的网页通过IFrame嵌入它自己的网页。
            <br>
            这样就不好玩了，那么如何来阻止这样行为呢？
            <div class="syntaxhighlighter  jscript" id="highlighter_920111"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_920111_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_920111" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">if</code><code class="jscript plain">(top !== window) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;</code><code class="jscript plain">top.location.href = window.location.href;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div></div></div>
            这段代码应该放在你每个页面的<em>head</em>中，如果你想知道现实中有没人在用，看看baidu的博客你就知道了。
            <br>
            <br>
            <br>
        </li>
        <li><strong>字符串替换</strong><br>
            <em>String.prototype.replace</em>函数经常会让那些非常熟悉C#或者Java的程序员感到迷惑。
            <br>
            比如：
            <div class="syntaxhighlighter  jscript" id="highlighter_692220"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_692220_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_692220" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript string">'Hello world, hello world'</code><code class="jscript plain">.replace(</code><code class="jscript string">'world'</code><code class="jscript plain">, </code><code class="jscript string">'JavaScript'</code><code class="jscript plain">);</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript comments">// The result is "Hello JavaScript, hello world"</code></td></tr></tbody></table></div></div></div>
            <em>replace</em>函数的第一个参数是正则表达式。<br>
            如果你传递一个字符串到第一个参数，则只有第一个找到的匹配字符串被替换。
            <br>
            为了解决这个问题，我们可以使用正则表达式：
            <div class="syntaxhighlighter  jscript" id="highlighter_307973"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_307973_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_307973" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript string">'Hello world, hello world'</code><code class="jscript plain">.replace(/world/g, </code><code class="jscript string">'JavaScript'</code><code class="jscript plain">);</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript comments">// The result is "Hello JavaScript, hello JavaScript"</code></td></tr></tbody></table></div></div></div>
            我们还可以指定在替换时忽略大小写：
            <div class="syntaxhighlighter  jscript" id="highlighter_290908"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_290908_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_290908" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript string">'Hello world, hello world'</code><code class="jscript plain">.replace(/hello/gi, </code><code class="jscript string">'Hi'</code><code class="jscript plain">);</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript comments">// The result is "Hi world, Hi world"</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>将arguments转化为数组</strong><br>
            函数中的预定义变量<em>arguments</em>并非一个真正的数组，而是一个类似数组的对象。
            <br>
            它具有<em>length</em>属性，但是没有slice, push, sort等函数，那么如何使<em>arguments</em>具有这些数组才有的函数呢？
            <br>
            也就是说如何使<em>arguments</em>变成一个真正的数组呢？
            <div class="syntaxhighlighter  jscript" id="highlighter_833132"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_833132_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_833132" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">args() {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">[].slice.call(arguments, 0);</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">args(2, 5, 8); </code><code class="jscript comments">// [2, 5, 8]</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>为parseInt函数指定第二个参数</strong><br>
            <em>parseInt</em>用来将字符串转化为整形的数字，语法为：
            <div class="syntaxhighlighter  jscript" id="highlighter_743560"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_743560_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_743560" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">parseInt(str, [radix])</code></td></tr></tbody></table></div></div></div>
            其中第二个参数是可选的，用来指定第一个参数是几进制的。
            <br>
            如果没有传递第二个参数，则按照如下规则：<br>
            -&gt;如果<em>str</em>以 0x 开头，则认为是16进制。<br>
            -&gt;如果<em>str</em>以 0 开头，则认为是8进制。<br>
            -&gt;否则，认为是10进制。<br>
            因此如下的代码将会让人很迷惑，如果你不知道这些规则：
            <div class="syntaxhighlighter  jscript" id="highlighter_201580"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_201580_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_201580" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">parseInt(</code><code class="jscript string">'08'</code><code class="jscript plain">); </code><code class="jscript comments">// 0</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">parseInt(</code><code class="jscript string">'08'</code><code class="jscript plain">, 10); </code><code class="jscript comments">// 8</code></td></tr></tbody></table></div></div></div>
            <br>
            所以，安全起见一定要为<em>parseInt</em>指定第二个参数。
            <br>
            <br>
        </li>
        <li><strong>从数组中删除一个元素</strong>
            <br>
            或许我们可以通过<em>delete</em>来做到：
            <div class="syntaxhighlighter  jscript" id="highlighter_719311"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_719311_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_719311" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">arr = [1, 2, 3, 4, 5];</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">delete</code> <code class="jscript plain">arr[1];</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">arr; </code><code class="jscript comments">// [1, undefined, 3, 4, 5]</code></td></tr></tbody></table></div></div></div>
            可以看到，<em>delete</em>并不能真正的删除数组中的一个元素。删除的元素会被<em>undefined</em>取代，数组的长度并没有变化。
            <br>
            <br>
            事实上，我们可以通过Array.prototype中的<em>splice</em>函数来删除数组中的元素，如下所示：
            <div class="syntaxhighlighter  jscript" id="highlighter_984234"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_984234_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_984234" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">arr = [1, 2, 3, 4, 5];</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">arr.splice(1, 1);</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">arr; </code><code class="jscript comments">// [1, 3, 4, 5]</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>函数也是对象</strong><br>
            在JavaScript中函数也是对象，因为我们可以为函数添加属性。
            <br>
            比如：
            <div class="syntaxhighlighter  jscript" id="highlighter_360827"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_360827_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_360827" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">add() {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">add.count++;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">add.count = 0;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">add();&nbsp;&nbsp;&nbsp; </code><code class="jscript comments">// 0</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript plain">add();&nbsp;&nbsp;&nbsp; </code><code class="jscript comments">// 1</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">add();&nbsp;&nbsp;&nbsp; </code><code class="jscript comments">// 2</code></td></tr></tbody></table></div></div></div>
            我们为函数<em>add</em>添加了<em>count</em>属性，用来记录此函数被调用的次数。
            <br>
            <br>
            当然这可以通过更优雅的方式来实现：
            <div class="syntaxhighlighter  jscript" id="highlighter_562692"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_562692_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_562692" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">add() {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">if</code><code class="jscript plain">(!arguments.callee.count) {</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">arguments.callee.count = 0;</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">arguments.callee.count++;</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">add();&nbsp;&nbsp;&nbsp; </code><code class="jscript comments">// 0</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>8</code></td><td class="content"><code class="jscript plain">add();&nbsp;&nbsp;&nbsp; </code><code class="jscript comments">// 1</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>9</code></td><td class="content"><code class="jscript plain">add();&nbsp;&nbsp;&nbsp; </code><code class="jscript comments">// 2</code></td></tr></tbody></table></div></div></div>
            <em>arguments.callee</em>指向当前正在运行的函数。
            <br>
            <br>
            <br>
        </li>
        <li><strong>数组中的最大值</strong><br>
            如何在全是数字的数组中找到最大值，我们可以简单的通过循环来完成：
            <div class="syntaxhighlighter  jscript" id="highlighter_773292"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_773292_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_773292" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">arr = [2, 3, 45, 12, 8];</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">max = arr[0];</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript keyword">for</code><code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i </code><code class="jscript keyword">in</code> <code class="jscript plain">arr) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">if</code><code class="jscript plain">(arr[i] &gt; max) {</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">max = arr[i];</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>8</code></td><td class="content"><code class="jscript plain">max; </code><code class="jscript comments">// 45</code></td></tr></tbody></table></div></div></div>
            有没有其他方法？我们都知道JavaScript中有一个<em>Math</em>对象进行数字的处理：
            <div class="syntaxhighlighter  jscript" id="highlighter_8863"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_8863_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_8863" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">Math.max(2, 3, 45, 12, 8); </code><code class="jscript comments">// 45</code></td></tr></tbody></table></div></div></div>
            然后，我们可以这样来找到数组中最大值：
            <div class="syntaxhighlighter  jscript" id="highlighter_503416"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_503416_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_503416" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">arr = [2, 3, 45, 12, 8];</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">Math.max.apply(</code><code class="jscript keyword">null</code><code class="jscript plain">, arr); </code><code class="jscript comments">// 45</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>为IE添加<em>console.log</em>函数</strong>
            <br>
            在Firefox下并有Firebug的支持下，我们经常使用<em>console.log</em>来在控制台记录一些信息。
            <br>
            但是这种做法在IE下会阻止JavaScript的执行（在Firefox下没有启用Firebug情况下也是一样），因为此时根本没有<em>console</em>对象存在。
            <br>
            我们可以通过如下小技巧来防止这样情况的发生：
            <div class="syntaxhighlighter  jscript" id="highlighter_312798"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_312798_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_312798" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">if</code> <code class="jscript plain">(</code><code class="jscript keyword">typeof</code><code class="jscript plain">(console) === </code><code class="jscript string">'undefined'</code><code class="jscript plain">) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">window.console = {</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">log: </code><code class="jscript keyword">function</code><code class="jscript plain">(msg) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">alert(msg);</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">};</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>8</code></td><td class="content"><code class="jscript plain">console.log(</code><code class="jscript string">'debug info.'</code><code class="jscript plain">);</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong><em>undefined</em>是JavaScript中保留关键字么？</strong><br>
            看起来像是的，但实际上undefined并不是JavaScript中的关键字:
            <div class="syntaxhighlighter  jscript" id="highlighter_694734"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_694734_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_694734" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">undefined = </code><code class="jscript string">'Hello'</code><code class="jscript plain">;&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">undefined; </code><code class="jscript comments">// 'Hello'</code></td></tr></tbody></table></div></div></div>
            这段代码可能会让你感到很奇怪，不过它的确能够正常运行，<em>undefined</em>只是JavaScript中一个预定义的变量而已。
            <br>
            注：在JavaScript程序中，千万不要这样做，这个技巧只是告诉你有这么一回事而已。
            <br>
            <br>
            <br>
        </li>
        <li><strong>判断一个变量是否为undefined</strong><br>
            两种情况下，一个变量为undefined：
            <br>
            1. 声明了变量，但是没有赋值
            <div class="syntaxhighlighter  jscript" id="highlighter_416561"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_416561_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_416561" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">name;&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">name === undefined; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            2. 从来没有声明过此变量
            <div class="syntaxhighlighter  jscript" id="highlighter_550644"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_550644_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_550644" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">name2 === undefined; </code><code class="jscript comments">// error – name2 is not defined</code></td></tr></tbody></table></div></div></div>
            在第二种情况下，会有一个错误被抛出，那么如果判断一个变量是否为undefined而不产生错误呢？
            <br>
            下面提供了一种通用的方法：
            <div class="syntaxhighlighter  jscript" id="highlighter_332639"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_332639_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_332639" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">typeof</code><code class="jscript plain">(name2) === ‘undefined’; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>预加载图片</strong>
            <br>
            预加载图片就是加载页面上不存在的图片，以便以后使用JavaScript把它们快速显示出来。
            <br>
            比如你想在鼠标移动到某个图片上时显示另一张图片:
            <div class="syntaxhighlighter  jscript" id="highlighter_814882"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_814882_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_814882" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">img = </code><code class="jscript keyword">new</code> <code class="jscript plain">Image();&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">img.src = </code><code class="jscript string">"clock2.gif"</code><code class="jscript plain">;</code></td></tr></tbody></table></div></div></div>
            <div class="syntaxhighlighter  xml" id="highlighter_204664"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_204664_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_204664" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="xml plain">&lt;</code><code class="xml keyword">img</code> <code class="xml color1">src</code><code class="xml plain">=</code><code class="xml string">"clock.gif"</code> <code class="xml color1">mce_src</code><code class="xml plain">=</code><code class="xml string">"clock.gif"</code> <code class="xml color1">alt</code><code class="xml plain">=</code><code class="xml string">""</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="xml color1">onmouseover</code><code class="xml plain">=</code><code class="xml string">"this.src='clock2.gif';"</code>&nbsp;&nbsp;</td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="xml color1">onmouseout</code><code class="xml plain">=</code><code class="xml string">"this.src=clock.gif';"</code> <code class="xml plain">/&gt;</code></td></tr></tbody></table></div></div></div>
            <br>
            那么，如何加载一组图片呢？考虑如下代码：
            <div class="syntaxhighlighter  jscript" id="highlighter_742285"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_742285_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_742285" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">source = [</code><code class="jscript string">'img1.gif'</code><code class="jscript plain">,</code><code class="jscript string">'img2.gif'</code><code class="jscript plain">];&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">img = </code><code class="jscript keyword">new</code> <code class="jscript plain">Image();&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript keyword">for</code><code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i = 0; i &lt; source.length; i++) {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">img.src = source[i];&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div></div></div>
            实际上，这段代码只能预加载最后的一张图片，因为其他的图片根本没有时间来预加载在循环到来的时候。
            <br>
            因此正确的写法应该是：
            <div class="syntaxhighlighter  jscript" id="highlighter_940684"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_940684_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_940684" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">source = [</code><code class="jscript string">'img1.gif'</code><code class="jscript plain">,</code><code class="jscript string">'img2.gif'</code><code class="jscript plain">];&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">for</code><code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i = 0; i &lt; source.length; i++) {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">var</code> <code class="jscript plain">img = </code><code class="jscript keyword">new</code> <code class="jscript plain">Image();&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">img.src = source[i];&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>闭包（closure）</strong>
            <br>
            闭包指的是函数内的局部变量，当函数返回时此变量依然可用。
            <br>
            当你在函数内部定义另外一个函数时，你就创建了一个闭包，一个著名的例子：
            <br>
            <div class="syntaxhighlighter  jscript" id="highlighter_610572"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_610572_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_610572" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">add(i) {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript keyword">function</code><code class="jscript plain">() {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">++i;&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">};&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">}&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript plain">add(2).toString(); </code><code class="jscript comments">// "function () { return ++i; }"&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">add(2)(); </code><code class="jscript comments">// 3</code></td></tr></tbody></table></div></div></div>
            <em>add(2)</em>是一个函数，它可能获取外部函数的局部变量<em>i</em>。
            <br>
            <a href="http://blog.morrisjohns.com/javascript_closures_for_dummies">参考文章</a>
            <br>
            <br>
            <br>
        </li>
        <li><strong>私有变量</strong><br>
            我们经常使用命名规范来标示一个变量是否为私有变量（最常用来标示）：
            <div class="syntaxhighlighter  jscript" id="highlighter_152510"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_152510_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_152510" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">person = {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">_name: </code><code class="jscript string">''</code><code class="jscript plain">,&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">getName: </code><code class="jscript keyword">function</code><code class="jscript plain">() {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript keyword">this</code><code class="jscript plain">._name || </code><code class="jscript string">'not defined'</code><code class="jscript plain">;&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">}&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript plain">};&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">person.getName(); </code><code class="jscript comments">// "not defined"</code></td></tr></tbody></table></div></div></div>
            下划线前缀用来作为私有变量的约定，但是其他开发人员仍然可以调用此私有变量：
            <div class="syntaxhighlighter  jscript" id="highlighter_174572"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_174572_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_174572" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">person._name; </code><code class="jscript comments">// ""</code></td></tr></tbody></table></div></div></div>
            那么，如何在JavaScript中创建一个真正的私有变量呢？
            <br>
            主要技巧是使用匿名函数（anonymous function）和闭包（closure）。
            <div class="syntaxhighlighter  jscript" id="highlighter_659724"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_659724_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_659724" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>01</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">person = {};&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>02</code></td><td class="content"><code class="jscript plain">(</code><code class="jscript keyword">function</code><code class="jscript plain">() {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>03</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">var</code> <code class="jscript plain">_name = </code><code class="jscript string">''</code><code class="jscript plain">;&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>04</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">person.getName = </code><code class="jscript keyword">function</code><code class="jscript plain">() {&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>05</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">_name || </code><code class="jscript string">'not defined'</code><code class="jscript plain">;&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>06</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">}&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>07</code></td><td class="content"><code class="jscript plain">})();&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>08</code></td><td class="content">&nbsp;</td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>09</code></td><td class="content"><code class="jscript plain">person.getName(); </code><code class="jscript comments">// "not defined"&nbsp;&nbsp; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>10</code></td><td class="content"><code class="jscript keyword">typeof</code><code class="jscript plain">(person._name); </code><code class="jscript comments">// "undefined"</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>JavaScript没有块级上下文（Scope）</strong><br>
            JavaScript中块级代码没有上下文，实际上只有函数有自己的上下文。
            <div class="syntaxhighlighter  jscript" id="highlighter_623858"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_623858_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_623858" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">for</code><code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i = 0; i &lt; 2; i ++) { </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content">&nbsp;</td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">} </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">i;&nbsp; </code><code class="jscript comments">// 2</code></td></tr></tbody></table></div></div></div>
            如果想创建一个上下文，可以使用自执行的匿名函数：
            <div class="syntaxhighlighter  jscript" id="highlighter_57532"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_57532_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_57532" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">(</code><code class="jscript keyword">function</code> <code class="jscript plain">(){ </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">for</code><code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i = 0; i &lt; 2; i ++) { </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code>&nbsp;</td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">})(); </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript keyword">typeof</code><code class="jscript plain">(i) === </code><code class="jscript string">'undefined'</code><code class="jscript plain">;&nbsp; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>怪异的NaN</strong><br>
            NaN用来表示一个值不是数字。<br>
            NaN在JavaScript中行为很怪异，是因为那NaN和任何值都不相等（包括它自己）。
            <div class="syntaxhighlighter  jscript" id="highlighter_937491"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_937491_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_937491" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">NaN === NaN; </code><code class="jscript comments">// false</code></td></tr></tbody></table></div></div></div>
            因为下面的代码可能会让一些人抓狂：
            <div class="syntaxhighlighter  jscript" id="highlighter_551048"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_551048_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_551048" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">parseInt(</code><code class="jscript string">'hello'</code><code class="jscript plain">, 10); </code><code class="jscript comments">// NaN </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">parseInt(</code><code class="jscript string">'hello'</code><code class="jscript plain">, 10) == NaN; </code><code class="jscript comments">// false </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">parseInt(</code><code class="jscript string">'hello'</code><code class="jscript plain">, 10) === NaN; </code><code class="jscript comments">// false</code></td></tr></tbody></table></div></div></div>
            那么如何来检查一个值是否NaN?<br>
            可以使用window.isNaN来判断：
            <div class="syntaxhighlighter  jscript" id="highlighter_977842"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_977842_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_977842" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">isNaN(parseInt(</code><code class="jscript string">'hello'</code><code class="jscript plain">, 10)); </code><code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>真值和假值</strong><br>
            JavaScript中所有值都能隐式地转化为Boolean类型。<br>
            在条件判断中，下面这些值会自动转化为false：<br>
            <em>null, undefined, NaN, 0, ‘’, false</em><br>
            因此，不需要做如下复杂的判断:
            <div class="syntaxhighlighter  jscript" id="highlighter_874830"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_874830_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_874830" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">if</code><code class="jscript plain">(obj === undefined || obj === </code><code class="jscript keyword">null</code><code class="jscript plain">) { </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div></div></div>
            而只需要这样做就行了：
            <div class="syntaxhighlighter  jscript" id="highlighter_999733"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_999733_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_999733" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">if</code><code class="jscript plain">(!obj) { </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content">&nbsp;</td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>修改arguments</strong><br>
            比如，添加一个值到arguments中：
            <div class="syntaxhighlighter  jscript" id="highlighter_48970"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_48970_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_48970" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">add() { </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">arguments.push(</code><code class="jscript string">'new value'</code><code class="jscript plain">); </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">} </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">add(); </code><code class="jscript comments">// error - arguments.push is not a function</code></td></tr></tbody></table></div></div></div>
            这样会出错，因为<em>arguments</em>不是一个真正的数组，没有push方法。
            <br>
            解决办法：
            <div class="syntaxhighlighter  jscript" id="highlighter_320182"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_320182_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_320182" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">function</code> <code class="jscript plain">add() { </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">Array.prototype.push.call(arguments, </code><code class="jscript string">'new value'</code><code class="jscript plain">); </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript keyword">return</code> <code class="jscript plain">arguments; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript plain">} </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">add()[0]; </code><code class="jscript comments">// "new value"</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>Boolean 和 new Boolean</strong><br>
            我们可以把Boolean看做是一个函数，用来产生Boolean类型的值（Literal）：
            <div class="syntaxhighlighter  jscript" id="highlighter_578229"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_578229_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_578229" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">Boolean(</code><code class="jscript keyword">false</code><code class="jscript plain">) === </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// true </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">Boolean(</code><code class="jscript string">''</code><code class="jscript plain">) === </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            所以，<em>Boolean(0)</em>和<em>!!0</em>是等价的。
            <br>
            我们也可以把Boolean看做是一个构造函数，通过<em>new</em>来创建一个Boolean类型的对象：
            <div class="syntaxhighlighter  jscript" id="highlighter_874413"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_874413_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_874413" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">new</code> <code class="jscript plain">Boolean(</code><code class="jscript keyword">false</code><code class="jscript plain">) === </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// false </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">new</code> <code class="jscript plain">Boolean(</code><code class="jscript keyword">false</code><code class="jscript plain">) == </code><code class="jscript keyword">false</code><code class="jscript plain">; </code><code class="jscript comments">// true </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript keyword">typeof</code><code class="jscript plain">(</code><code class="jscript keyword">new</code> <code class="jscript plain">Boolean(</code><code class="jscript keyword">false</code><code class="jscript plain">)); </code><code class="jscript comments">// "object" </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="jscript keyword">typeof</code><code class="jscript plain">(Boolean(</code><code class="jscript keyword">false</code><code class="jscript plain">)); </code><code class="jscript comments">// "boolean"</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>快速字符串连接</strong><br>
            我们经常使用<em>+</em>将较短的字符串连接为一个长字符串，这在大部分的情况下是没问题的。
            <br>
            但是如果有大量的字符串需要连接，这种做法将会遇到性能问题，尤其是在IE下。
            <br>
            <div class="syntaxhighlighter  jscript" id="highlighter_538035"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_538035_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_538035" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">startTime = </code><code class="jscript keyword">new</code> <code class="jscript plain">Date();</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">str = </code><code class="jscript string">''</code><code class="jscript plain">;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript keyword">for</code> <code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i = 0; i &lt; 50000; i++) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">str += i;</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript plain">alert(</code><code class="jscript keyword">new</code> <code class="jscript plain">Date() - startTime);&nbsp; </code><code class="jscript comments">// Firefox - 18ms, IE7 - 2060ms</code></td></tr></tbody></table></div></div></div>
            <div class="syntaxhighlighter  jscript" id="highlighter_30577"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_30577_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_30577" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">startTime = </code><code class="jscript keyword">new</code> <code class="jscript plain">Date();</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">arr = [];</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript keyword">for</code> <code class="jscript plain">(</code><code class="jscript keyword">var</code> <code class="jscript plain">i = 0; i &lt; 100000; i++) {</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="jscript plain">arr.push(i);</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>5</code></td><td class="content"><code class="jscript plain">}</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>6</code></td><td class="content"><code class="jscript keyword">var</code> <code class="jscript plain">str = arr.join(</code><code class="jscript string">""</code><code class="jscript plain">);</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>7</code></td><td class="content"><code class="jscript plain">alert(</code><code class="jscript keyword">new</code> <code class="jscript plain">Date() - startTime); </code><code class="jscript comments">// Firefox - 38ms, IE7 - 280ms</code></td></tr></tbody></table></div></div></div>
            <br>
            可以看到Firefox似乎对<em>+</em>操作符进行了优化，而IE则表现的傻乎乎的。
            <br>
            <br>
        </li>
        <li><strong>一元操作符 + </strong>
            <blockquote>
                在JavaScript中，我们可以在字符串之前使用一元操作符“+”。这将会把字符串转化为数字，如果转化失败则返回NaN。
            </blockquote>
            <div class="syntaxhighlighter  jscript" id="highlighter_573555"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_573555_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_573555" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">2 + </code><code class="jscript string">'1'</code><code class="jscript plain">; </code><code class="jscript comments">// "21"</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">2 + ( +</code><code class="jscript string">'1'</code><code class="jscript plain">); </code><code class="jscript comments">// 3</code></td></tr></tbody></table></div></div></div>
            <blockquote>
                如果把 + 用在非字符串的前面，将按照如下顺序进行尝试转化：
                <ol>
                    <li>调用valueOf()</li>
                    <li>调用toString()</li>
                    <li>转化为数字</li>
                </ol>
            </blockquote>
            <div class="syntaxhighlighter  jscript" id="highlighter_931674"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_931674_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_931674" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">+</code><code class="jscript keyword">new</code> <code class="jscript plain">Date; </code><code class="jscript comments">// 1242616452016</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">+</code><code class="jscript keyword">new</code> <code class="jscript plain">Date === </code><code class="jscript keyword">new</code> <code class="jscript plain">Date().getTime(); </code><code class="jscript comments">// true</code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="jscript plain">+</code><code class="jscript keyword">new</code> <code class="jscript plain">Date() === Number(</code><code class="jscript keyword">new</code> <code class="jscript plain">Date) </code><code class="jscript comments">// true</code></td></tr></tbody></table></div></div></div>
            <a href="http://xkr.us/articles/javascript/unary-add/">参考文章</a>
            <br>
            <br>
            <br>
        </li>
        <li><strong>encodeURI和encodeURIComponent</strong><br>
            window.encodeURI函数用来编码一个URL，但是不会对以下字符进行编码：“:”, “/”, “;”, “?”.
            <br>
            window.encodeURIComponent则会对上述字符进行编码。<br>
            我们通过一个例子来说明：
            <div class="syntaxhighlighter  jscript" id="highlighter_881084"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_881084_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_881084" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript string">'index.jsp?page='</code><code class="jscript plain">+encodeURI(</code><code class="jscript string">'/page/home.jsp'</code><code class="jscript plain">);&nbsp; </code><code class="jscript comments">// "index.jsp?page=/page/home.jsp"</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript string">'index.jsp?page='</code><code class="jscript plain">+encodeURIComponent(</code><code class="jscript string">'/page/home.jsp'</code><code class="jscript plain">);&nbsp; </code><code class="jscript comments">// "index.jsp?page=%2Fpage%2Fhome.jsp"</code></td></tr></tbody></table></div></div></div>
            因此，在对URL进行编码时我们经常会选择 encodeURIComponent。
            <br>
            <br>
            <br>
        </li>
        <li><strong>table.innerHTML在IE下是只读属性</strong><br>
            我们经常通过节点的<em>innerHTML</em>属性来填充节点，比如：
            <div class="syntaxhighlighter  xml" id="highlighter_439735"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_439735_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_439735" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="xml plain">&lt;</code><code class="xml keyword">div</code> <code class="xml color1">id</code><code class="xml plain">=</code><code class="xml string">"container1"</code><code class="xml plain">&gt; &lt;/</code><code class="xml keyword">div</code><code class="xml plain">&gt;</code></td></tr></tbody></table></div></div></div>
            <div class="syntaxhighlighter  jscript" id="highlighter_663787"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_663787_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_663787" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">document.getElementById(</code><code class="jscript string">'container1'</code><code class="jscript plain">).innerHTML = </code><code class="jscript string">"Hello World!"</code><code class="jscript plain">;</code></td></tr></tbody></table></div></div></div>
            但是在IE下设置<em>table.innerHTML</em>将会导致错误：
            <div class="syntaxhighlighter  xml" id="highlighter_463555"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_463555_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_463555" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="xml plain">&lt;</code><code class="xml keyword">table</code> <code class="xml color1">id</code><code class="xml plain">=</code><code class="xml string">"table1"</code><code class="xml plain">&gt; &lt;/</code><code class="xml keyword">table</code><code class="xml plain">&gt;</code></td></tr></tbody></table></div></div></div>
            <div class="syntaxhighlighter  jscript" id="highlighter_728395"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_728395_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_728395" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript comments">// works well in Firefox, but fail to work in IE</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">document.getElementById(</code><code class="jscript string">'table1'</code><code class="jscript plain">).innerHTML = </code><code class="jscript string">"&lt;tr&gt;&lt;td&gt;Hello&lt;/td&gt;&lt;td&gt;World!&lt;/td&gt;&lt;/tr&gt;"</code><code class="jscript plain">;</code></td></tr></tbody></table></div></div></div>
            实际上，table, thead, tr, select等元素的innerHTML属性在IE下都是只读的。
            <br>
            <br>
            那么如果动态的创建一个table呢，下面提供了一种可行的方法：
            <div class="syntaxhighlighter  xml" id="highlighter_624642"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_624642_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_624642" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="xml plain">&lt;</code><code class="xml keyword">div</code> <code class="xml color1">id</code><code class="xml plain">=</code><code class="xml string">"table1"</code><code class="xml plain">&gt; &lt;/</code><code class="xml keyword">div</code><code class="xml plain">&gt;</code></td></tr></tbody></table></div></div></div>
            <div class="syntaxhighlighter  jscript" id="highlighter_890940"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_890940_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_890940" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">document.getElementById(</code><code class="jscript string">'table1'</code><code class="jscript plain">).innerHTML = </code><code class="jscript string">"&lt;table&gt;&lt;tr&gt;&lt;td&gt;Hello&lt;/td&gt;&lt;td&gt;World!&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;"</code><code class="jscript plain">;</code></td></tr></tbody></table></div></div></div>
            <br>
            <br>
        </li>
        <li><strong>0.1+0.2 != 0.3</strong><br>
            JavaScript将小数作为浮点数对待，所以可能会产生一些四舍五入的错误，比如：
            <div class="syntaxhighlighter  jscript" id="highlighter_252006"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_252006_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_252006" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">0.1 + 0.2; </code><code class="jscript comments">// 0.30000000000000004</code></td></tr></tbody></table></div></div></div>
            你可以通过toFixed方法指定四舍五入的小数位数：
            <div class="syntaxhighlighter  jscript" id="highlighter_716447"><div class="bar"><div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="#viewSource">view source</a><div class="item copyToClipboard"><embed id="highlighter_716447_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_716447" menu="false" src="clipboard.swf" height="16" width="16"></div><a class="item printSource" style="width: 16px; height: 16px;" title="print" href="#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="#about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="jscript plain">(0.1 + 0.2).toFixed(); </code><code class="jscript comments">// "0"</code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="jscript plain">(0.1 + 0.2).toFixed(1); </code><code class="jscript comments">// "0.3"</code></td></tr></tbody></table></div></div></div>
        </li>
    </ol>
    <br>
    <br>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1556677,52411,1)"> 
		<span class="diggnum" id="digg_count_1556677">8</span>
	</div>
	<div class="buryit" onclick="DiggIt(1556677,52411,2)"> 
		<span class="burynum" id="bury_count_1556677">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1556677">0</span>	
	<div class="diggword" id="digg_word_1556677">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/sanshi/archive/2009/08/29/1556438.html">« </a> 上一篇：<a href="http://www.cnblogs.com/sanshi/archive/2009/08/29/1556438.html" title="发布于2009-08-29 20:59">基于Extjs的开源控件库 - http://extaspnet.codeplex.com/</a><br>
<a href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556913.html">» </a> 下一篇：<a href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556913.html" title="发布于2009-08-30 22:37">ExtAspNet应用技巧（十二） - 系统登录</a><br>
</div>








		</div>
		<div class="postDesc">posted @ 2009-08-30 14:58 <a href="http://www.cnblogs.com/sanshi/">三生石上</a> 阅读(3300) <a href="#commentform">评论(25)</a> &nbsp;<a href="http://www.cnblogs.com/sanshi/admin/EditPosts.aspx?postid=1556677">编辑</a> <a href="http://www.cnblogs.com/sanshi/AddToFavorite.aspx?id=1556677">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/sanshi/category/176612.html">Javascript</a></div>
	</div>
	<img src="1556677.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html"
dc:identifier="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/sanshi/services/trackbacks/1556677.aspx" />
</rdf:RDF>
-->

</div><!--end: topics 文章、评论容器-->
<a name="pagedcomment"></a>
<!--done-->
<br>
<div class="feedback_area_title">评论</div>
<div class="feedbackNoItems"><span id="span_comment_maxid" style="display: none;">1657519</span></div>
	

		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("李子哥哥",1630232,"C/WPM4lg+XESpeaX4k9B0twdgktEoiAJRiCzdxD8jbmMzrJUuba+3w==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630232,"C/WPM4lg+XESpeaX4k9B0twdgktEoiAJRiCzdxD8jbmMzrJUuba+3w==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%9d%8e%e5%ad%90%e5%93%a5%e5%93%a5" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630232">#1楼</a><a name="1630232" id="comment_anchor_1630232"></a>2009-08-30 18:05 | <a id="Comments1_CommentList_ctl00_NameLink" href="http://www.cnblogs.com/kuiyouli/" target="_top">李子哥哥</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%9d%8e%e5%ad%90%e5%93%a5%e5%93%a5" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630232" class="blog_comment_body">LZ辛苦<br><br>不过里面好像有个错误<br><br>为参数赋初值中<br><br>plus(2, 0); 结果等于3<br><br>也就是说<br><br>0||1 ＝＝＝1</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Kai.Ma",1630241,"vOipMccbvp+kMeR8IGg2mVclr7Welyb7p5xmezJgLIg/aq56IJ1cUA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630241,"vOipMccbvp+kMeR8IGg2mVclr7Welyb7p5xmezJgLIg/aq56IJ1cUA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Kai.Ma" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630241">#2楼</a><a name="1630241" id="comment_anchor_1630241"></a>2009-08-30 18:26 | <a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/kaima/" target="_top">Kai.Ma</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Kai.Ma" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630241" class="blog_comment_body">图片预加载“因为其他的图片根本没有时间来预加载在循环到来的时候。”<br>这个说法有点拗口，我觉得可以接这样解释：如果说结果真的只加载最后一张图片，那就说明img.src=""这个语句是以闭包函数形式实现的，伪代码应该是：<br>img.setSrc=function(src){<br><br>}<br>总所周知，循环中的闭包，经常只取最后一个索引的。<br><br>我只是猜测。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("sanshi",1630258,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630258,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sanshi" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630258">#3楼</a><a name="1630258" id="comment_anchor_1630258"></a>[<span class="louzhu">楼主</span>]2009-08-30 19:25 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/sanshi/" target="_top">sanshi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sanshi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630258" class="blog_comment_body"><fieldset class="comment_quote"><legend><a href="#1630232" title="查看引用原文">引用</a></legend>李子哥哥：<br>LZ辛苦<br><br>不过里面好像有个错误<br><br>为参数赋初值中<br><br>plus(2, 0); 结果等于3<br><br>也就是说<br><br>0||1 ＝＝＝1</fieldset><br>你是对的，看来这个地方要做一些特殊处理了，呵呵</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("sanshi",1630261,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630261,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sanshi" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl03$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630261">#4楼</a><a name="1630261" id="comment_anchor_1630261"></a>[<span class="louzhu">楼主</span>]2009-08-30 19:29 | <a id="Comments1_CommentList_ctl03_NameLink" href="http://www.cnblogs.com/sanshi/" target="_top">sanshi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sanshi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630261" class="blog_comment_body"><fieldset class="comment_quote"><legend><a href="#1630241" title="查看引用原文">引用</a></legend>Kai.Ma：<br>图片预加载“因为其他的图片根本没有时间来预加载在循环到来的时候。”<br>这个说法有点拗口，我觉得可以接这样解释：如果说结果真的只加载最后一张图片，那就说明img.src=""这个语句是以闭包函数形式实现的，伪代码应该是：<br>img.setSrc=function(src){<br><br>}<br>总所周知，循环中的闭包，经常只取最后一个索引的。<br><br>我只是猜测。</fieldset><br>闭包中的循环只取最后一个索引，那是因为块级代码段没有上下文，它们引用的是同一个变量。<br><br>img.src = ""，引用图片到图片完全加载是需要一定时间的，我还倾向于认为是在第一张图片还没加载完成的时候，已经改变了img.src属性开始加载第二张图片，以此类推直到数组中的最后一个图片。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("super Yu",1630262,"ArSLGOi85GT5mLVz3RWGwiCfcD2KaBcKmn4Ndq9TSuAhF1yP04AFhQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630262,"ArSLGOi85GT5mLVz3RWGwiCfcD2KaBcKmn4Ndq9TSuAhF1yP04AFhQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=super+Yu" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl04$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630262">#5楼</a><a name="1630262" id="comment_anchor_1630262"></a>2009-08-30 19:30 | <a id="Comments1_CommentList_ctl04_NameLink" href="http://home.cnblogs.com/68981/" target="_top">super Yu</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/super+Yu" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630262" class="blog_comment_body">不错，顶一下！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Kai.Ma",1630297,"vOipMccbvp+kMeR8IGg2mVclr7Welyb7p5xmezJgLIg/aq56IJ1cUA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630297,"vOipMccbvp+kMeR8IGg2mVclr7Welyb7p5xmezJgLIg/aq56IJ1cUA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Kai.Ma" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl05$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630297">#6楼</a><a name="1630297" id="comment_anchor_1630297"></a>2009-08-30 20:17 | <a id="Comments1_CommentList_ctl05_NameLink" href="http://www.cnblogs.com/kaima/" target="_top">Kai.Ma</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Kai.Ma" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630297" class="blog_comment_body"><fieldset class="comment_quote"><legend><a href="#1630261" title="查看引用原文">引用</a></legend>sanshi：<br>闭包中的循环只取最后一个索引，那是因为块级代码段没有上下文，它们引用的是同一个变量。<br><br>img.src = ""，引用图片到图片完全加载是需要一定时间的，我还倾向于认为是在第一张图片还没加载完成的时候，已经改变了img.src属性开始加载第二张图片，以此类推直到数组中的最后一个图片。</fieldset><br>你的解释还是比较中肯的。<br><br>我还有个疑问，这种加载是异步的，第一张没加载完就改变src后，会否中断之前的加载？如果没有中断的话，那之前的几张图片都实际上已经下载并缓存到客户端中了？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("sanshi",1630353,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630353,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sanshi" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl06$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630353">#7楼</a><a name="1630353" id="comment_anchor_1630353"></a>[<span class="louzhu">楼主</span>]2009-08-30 21:13 | <a id="Comments1_CommentList_ctl06_NameLink" href="http://www.cnblogs.com/sanshi/" target="_top">sanshi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sanshi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630353" class="blog_comment_body"><fieldset class="comment_quote"><legend><a href="#1630297" title="查看引用原文">引用</a></legend>Kai.Ma：<br><fieldset class="comment_quote"><legend>引用</legend>sanshi：<br>闭包中的循环只取最后一个索引，那是因为块级代码段没有上下文，它们引用的是同一个变量。<br><br>img.src = ""，引用图片到图片完全加载是需要一定时间的，我还倾向于认为是在第一张图片还没加载完成的时候，已经改变了img.src属性开始加载第二张图片，以此类推直到数组中的最后一个图片。</fieldset><br>你的解释还是比较中肯的。<br><br>我还有个疑问，这种加载是异步的，第一张没加载完就改变src后，会否中断之前的加载？如果没有中断的话，那之前的几张图片都实际上已经下载并缓存到客户端中了？</fieldset><br>所以我觉得不是没加载完就改变src，而是没有开始加载就改变src，因为在HttpWatch中仅仅只有一个对最后一张图片的HTTP请求。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("kkun",1630534,"crihfV7F7+c81Zlq5yduSsQ2E4iUwjkSGNey7bVJM+XZtBjr+0yWdw==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630534,"crihfV7F7+c81Zlq5yduSsQ2E4iUwjkSGNey7bVJM+XZtBjr+0yWdw==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=kkun" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl07$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630534">#8楼</a><a name="1630534" id="comment_anchor_1630534"></a>2009-08-31 08:56 | <a id="Comments1_CommentList_ctl07_NameLink" href="http://www.cnblogs.com/kkun/" target="_top">kkun</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/kkun" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630534" class="blog_comment_body">学到不少东西!谢谢楼主分享!</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("known",1630549,"xdj05AGyLC1gVSJRqzMOHN/Sl+0z5uD7kDvIBrSBPXqOqDnUlxnQhA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630549,"xdj05AGyLC1gVSJRqzMOHN/Sl+0z5uD7kDvIBrSBPXqOqDnUlxnQhA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=known" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl08$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630549">#9楼</a><a name="1630549" id="comment_anchor_1630549"></a>2009-08-31 09:09 | <a id="Comments1_CommentList_ctl08_NameLink" href="http://www.cnblogs.com/known/" target="_top">known</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/known" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630549" class="blog_comment_body">3ks lz<br>顶……</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("lib",1630558,"Hi7UQl3ZcFlOy7KSlKV6hJyfOCrH5pe1vqnNpcDypOviCNhyCKIueA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630558,"Hi7UQl3ZcFlOy7KSlKV6hJyfOCrH5pe1vqnNpcDypOviCNhyCKIueA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=lib" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl09$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630558">#10楼</a><a name="1630558" id="comment_anchor_1630558"></a>2009-08-31 09:16 | <a id="Comments1_CommentList_ctl09_NameLink" href="http://www.cnblogs.com/libsource/" target="_top">lib</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/lib" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630558" class="blog_comment_body">不错，学习</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("woalang",1630578,"30J1CwnaRV+wlIk+7D+A72fUGginhZtDb7/rIJ2PvVqq6rcv5lQ4uQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630578,"30J1CwnaRV+wlIk+7D+A72fUGginhZtDb7/rIJ2PvVqq6rcv5lQ4uQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=woalang" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl10$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630578">#11楼</a><a name="1630578" id="comment_anchor_1630578"></a>2009-08-31 09:33 | <a id="Comments1_CommentList_ctl10_NameLink" href="http://www.cnblogs.com/woalang/" target="_top">woalang</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/woalang" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630578" class="blog_comment_body">正在学Javasrcipt ,不错的参考资料，<br>不适合研读，但需要的时候可以来查查</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("懒得登陆",1630621,"")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630621,"")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl11$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630621">#12楼</a><a name="1630621" id="comment_anchor_1630621"></a>2009-08-31 10:02 | <a id="Comments1_CommentList_ctl11_NameLink" target="_blank">懒得登陆[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630621" class="blog_comment_body">棒.<br>赞。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Jonllen Peng",1630637,"9iPQoKC8bu9hdaYfe/K6JjynPeZXrQ6hhf7qGDC1fDrCe94HUgbtDQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630637,"9iPQoKC8bu9hdaYfe/K6JjynPeZXrQ6hhf7qGDC1fDrCe94HUgbtDQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Jonllen+Peng" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl12$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630637">#13楼</a><a name="1630637" id="comment_anchor_1630637"></a>2009-08-31 10:14 | <a id="Comments1_CommentList_ctl12_NameLink" href="http://www.cnblogs.com/Jonllen/" target="_top">Jonllen Peng</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Jonllen+Peng" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630637" class="blog_comment_body">很好的JavaScript资料,收藏了.</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("王金平",1630665,"i5/t5MABqzYMER3FX60PodTQeu14mGqYYRlVx935LKCbfQQJguCwlw==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630665,"i5/t5MABqzYMER3FX60PodTQeu14mGqYYRlVx935LKCbfQQJguCwlw==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%8e%8b%e9%87%91%e5%b9%b3" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl13$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630665">#14楼</a><a name="1630665" id="comment_anchor_1630665"></a>2009-08-31 10:32 | <a id="Comments1_CommentList_ctl13_NameLink" href="http://www.cnblogs.com/minzhuhu/" target="_top">王金平</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%8e%8b%e9%87%91%e5%b9%b3" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630665" class="blog_comment_body">总结的很好，受益匪浅！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("疯狂的程序员",1630940,"kJNC4ZIhoCF7XLry6djMKH5W21z1hQUz0XJq1wcNFRokxb8hBFgS2Q==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630940,"kJNC4ZIhoCF7XLry6djMKH5W21z1hQUz0XJq1wcNFRokxb8hBFgS2Q==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%96%af%e7%8b%82%e7%9a%84%e7%a8%8b%e5%ba%8f%e5%91%98" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl14$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630940">#15楼</a><a name="1630940" id="comment_anchor_1630940"></a>2009-08-31 14:58 | <a id="Comments1_CommentList_ctl14_NameLink" href="http://www.cnblogs.com/luofuxian/" target="_top">疯狂的程序员</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%96%af%e7%8b%82%e7%9a%84%e7%a8%8b%e5%ba%8f%e5%91%98" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630940" class="blog_comment_body">very good</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("李迪",1630961,"B0zmRPHMr61Vk43YfTgOoe65SaI6TqjeMpM1p+RDwFbn0ztu7rXyJg==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630961,"B0zmRPHMr61Vk43YfTgOoe65SaI6TqjeMpM1p+RDwFbn0ztu7rXyJg==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%9d%8e%e8%bf%aa" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl15$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630961">#16楼</a><a name="1630961" id="comment_anchor_1630961"></a>2009-08-31 15:21 | <a id="Comments1_CommentList_ctl15_NameLink" href="http://www.cnblogs.com/lshvs2005/" target="_top">李迪</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%9d%8e%e8%bf%aa" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630961" class="blog_comment_body">全部收藏，谢谢你的辛苦劳动</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("love4J",1630975,"H8DWTfhvY62m/anzYQO5Zz88/dqaqbwVPylX+Oqt9wnz1mee/u4iOg==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1630975,"H8DWTfhvY62m/anzYQO5Zz88/dqaqbwVPylX+Oqt9wnz1mee/u4iOg==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=love4J" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl16$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1630975">#17楼</a><a name="1630975" id="comment_anchor_1630975"></a>2009-08-31 15:27 | <a id="Comments1_CommentList_ctl16_NameLink" href="http://home.cnblogs.com/83602/" target="_top">love4J</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/love4J" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1630975" class="blog_comment_body">三石兄，辛苦了</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("abruzzi",1631034,"MIigWLOLzq3jEWAMSB/DdHoTUUwzTgYq768jVO+TK/stNZAdIkxVDw==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1631034,"MIigWLOLzq3jEWAMSB/DdHoTUUwzTgYq768jVO+TK/stNZAdIkxVDw==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=abruzzi" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl17$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1631034">#19楼</a><a name="1631034" id="comment_anchor_1631034"></a>2009-08-31 15:59 | <a id="Comments1_CommentList_ctl17_NameLink" href="http://www.cnblogs.com/abruzzi/" target="_top">abruzzi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/abruzzi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1631034" class="blog_comment_body">不错不错，谢谢分享</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一路走來",1631328,"W5DKOQbI+ZuPq8SemgJQQL9a1eWb6SzbC6LXYHsGjrOsrG+eZ25tiQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1631328,"W5DKOQbI+ZuPq8SemgJQQL9a1eWb6SzbC6LXYHsGjrOsrG+eZ25tiQ==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%80%e8%b7%af%e8%b5%b0%e4%be%86" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl18$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1631328">#20楼</a><a name="1631328" id="comment_anchor_1631328"></a>2009-08-31 21:02 | <a id="Comments1_CommentList_ctl18_NameLink" href="http://home.cnblogs.com/85022/" target="_top">一路走來</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%80%e8%b7%af%e8%b5%b0%e4%be%86" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1631328" class="blog_comment_body">辛苦了</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("曹赛楠",1631671,"WbtVh6v7SUnlUJzDLtpydkZqNS9x4duHtITZecW/ae/F2cW73kZoig==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1631671,"WbtVh6v7SUnlUJzDLtpydkZqNS9x4duHtITZecW/ae/F2cW73kZoig==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%9b%b9%e8%b5%9b%e6%a5%a0" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl19$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1631671">#21楼</a><a name="1631671" id="comment_anchor_1631671"></a>2009-09-01 09:48 | <a id="Comments1_CommentList_ctl19_NameLink" href="http://www.cnblogs.com/csn0721/" target="_top">曹赛楠</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%9b%b9%e8%b5%9b%e6%a5%a0" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1631671" class="blog_comment_body">好文收藏之</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("成西锋",1633123,"")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1633123,"")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl20$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1633123">#22楼</a><a name="1633123" id="comment_anchor_1633123"></a>2009-09-02 11:35 | <a id="Comments1_CommentList_ctl20_NameLink" target="_blank">成西锋[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1633123" class="blog_comment_body">恩，谢谢leizhang5，期待更多的js知识。。呵呵。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("sanshi",1633198,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1633198,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sanshi" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl21$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1633198">#23楼</a><a name="1633198" id="comment_anchor_1633198"></a>[<span class="louzhu">楼主</span>]2009-09-02 12:16 | <a id="Comments1_CommentList_ctl21_NameLink" href="http://www.cnblogs.com/sanshi/" target="_top">sanshi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sanshi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1633198" class="blog_comment_body"><a href="#1633123" title="查看所回复的评论">@</a>成西锋<br>暴露了...</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("xfcheng",1633858,"")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1633858,"")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl22_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl22$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl22_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1633858">#24楼</a><a name="1633858" id="comment_anchor_1633858"></a>2009-09-02 20:11 | <a id="Comments1_CommentList_ctl22_NameLink" target="_blank">xfcheng[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1633858" class="blog_comment_body"><a href="#1633198" title="查看所回复的评论">@</a>sanshi<br><br>太激动，失言了。。。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("eRic_",1657279,"TABT91UdeoS+Q9ZsPLJ0A54IXZ5O66kmq3f+sUsjPjsAMriuCgT/eA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1657279,"TABT91UdeoS+Q9ZsPLJ0A54IXZ5O66kmq3f+sUsjPjsAMriuCgT/eA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=eRic_" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl23_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl23$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl23_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1657279">#25楼</a><a name="1657279" id="comment_anchor_1657279"></a>2009-09-24 21:02 | <a id="Comments1_CommentList_ctl23_NameLink" href="http://www.cnblogs.com/extensive/" target="_top">eRic_</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/eRic_" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1657279" class="blog_comment_body">LinkButtonField与WindowField不能共存！由于在赶项目， 没有时间修复。 在新版本中解决下。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("sanshi",1657519,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1657519,"DTNBghbM1MxgaMEQ5/yrIwt+fhbftNn2LEG6R3uNPyoXhpMGB98ylA==")' href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sanshi" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl24_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl24$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl24_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1657519">#26楼</a><a name="1657519" id="comment_anchor_1657519"></a>[<span class="louzhu">楼主</span>]<a name="Post"></a>2009-09-25 09:07 | <a id="Comments1_CommentList_ctl24_NameLink" href="http://www.cnblogs.com/sanshi/" target="_top">sanshi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sanshi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1657519" class="blog_comment_body"><a href="#1657279" title="查看所回复的评论">@</a>eRic_<br>你可以看下我们的例子，很多就是LinkButtonField和WindowField共存的。 <a href="http://extasp.net/" target="_top">http://extasp.net/</a></span><br>
			</div>
		</div>
	




				
	</div><!--end: forFlow -->
	</div><!--end: mainContent 主体内容容器-->

	<div id="sideBar">
		<div id="sideBarMain">
			
<!--done-->
<div class="newsItem">
<h3 class="catListTitle">公告</h3>
	<div id="profile_block"><a href="http://home.cnblogs.com/sanshi/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/sanshi/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/sanshi/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/%e4%b8%89%e7%94%9f%e7%9f%b3%e4%b8%8a" target="_top">发短消息</a></div>
</div>

			<div id="calendar"><table id="Calendar1_entryCal" class="Cal" title="Calendar" border="0" cellpadding="0" cellspacing="0">
	<tbody><tr><td colspan="7"><table class="CalTitle" border="0" cellspacing="0">
		<tbody><tr><td class="CalNextPrev"><a href="javascript:__doPostBack('Calendar1$entryCal','V3469')" style="color: Black;" title="Go to the previous month">&lt;</a></td><td align="center">2009年8月</td><td class="CalNextPrev" align="right"><a href="javascript:__doPostBack('Calendar1$entryCal','V3531')" style="color: Black;" title="Go to the next month">&gt;</a></td></tr>
	</tbody></table></td></tr><tr><th class="CalDayHeader" abbr="日" scope="col" align="center">日</th><th class="CalDayHeader" abbr="一" scope="col" align="center">一</th><th class="CalDayHeader" abbr="二" scope="col" align="center">二</th><th class="CalDayHeader" abbr="三" scope="col" align="center">三</th><th class="CalDayHeader" abbr="四" scope="col" align="center">四</th><th class="CalDayHeader" abbr="五" scope="col" align="center">五</th><th class="CalDayHeader" abbr="六" scope="col" align="center">六</th></tr><tr><td class="CalOtherMonthDay" align="center">26</td><td class="CalOtherMonthDay" align="center">27</td><td class="CalOtherMonthDay" align="center">28</td><td class="CalOtherMonthDay" align="center">29</td><td class="CalOtherMonthDay" align="center">30</td><td class="CalOtherMonthDay" align="center">31</td><td class="CalWeekendDay" align="center">1</td></tr><tr><td class="CalWeekendDay" align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/2.html"><u>2</u></a></td><td align="center">3</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/4.html"><u>4</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/5.html"><u>5</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/6.html"><u>6</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/7.html"><u>7</u></a></td><td class="CalWeekendDay" align="center">8</td></tr><tr><td class="CalWeekendDay" align="center">9</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/10.html"><u>10</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/11.html"><u>11</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/12.html"><u>12</u></a></td><td align="center">13</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/14.html"><u>14</u></a></td><td class="CalWeekendDay" align="center">15</td></tr><tr><td class="CalWeekendDay" align="center">16</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/17.html"><u>17</u></a></td><td align="center">18</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/19.html"><u>19</u></a></td><td align="center">20</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/21.html"><u>21</u></a></td><td class="CalWeekendDay" align="center">22</td></tr><tr><td class="CalWeekendDay" align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/23.html"><u>23</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/24.html"><u>24</u></a></td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/25.html"><u>25</u></a></td><td align="center">26</td><td align="center">27</td><td align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/28.html"><u>28</u></a></td><td class="CalWeekendDay" align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/29.html"><u>29</u></a></td></tr><tr><td class="CalWeekendDay" align="center"><a href="http://www.cnblogs.com/sanshi/archive/2009/8/30.html"><u>30</u></a></td><td align="center">31</td><td class="CalOtherMonthDay" align="center">1</td><td class="CalOtherMonthDay" align="center">2</td><td class="CalOtherMonthDay" align="center">3</td><td class="CalOtherMonthDay" align="center">4</td><td class="CalOtherMonthDay" align="center">5</td></tr>
</tbody></table>
</div>
			
			<div id="leftcontentcontainer">
				
<div class="catListPostCategory">
<h3 class="catListTitle">随笔分类</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/sanshi/category/190357.html">ASP.NET(9)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to ASP.NET(9)" href="http://www.cnblogs.com/sanshi/category/190357.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/sanshi/category/190141.html">CSS(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to CSS(2)" href="http://www.cnblogs.com/sanshi/category/190141.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/sanshi/category/198782.html">ExtAsp.Net(50)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to ExtAsp.Net(50)" href="http://www.cnblogs.com/sanshi/category/198782.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/sanshi/category/195953.html">HTML</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to HTML" href="http://www.cnblogs.com/sanshi/category/195953.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" href="http://www.cnblogs.com/sanshi/category/176612.html">Javascript(36)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to Javascript(36)" href="http://www.cnblogs.com/sanshi/category/176612.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" href="http://www.cnblogs.com/sanshi/category/201132.html">jEditor(5)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to jEditor(5)" href="http://www.cnblogs.com/sanshi/category/201132.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" href="http://www.cnblogs.com/sanshi/category/189999.html">jQuery(10)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to jQuery(10)" href="http://www.cnblogs.com/sanshi/category/189999.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" href="http://www.cnblogs.com/sanshi/category/195952.html">JSLint-Toolkit(7)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to JSLint-Toolkit(7)" href="http://www.cnblogs.com/sanshi/category/195952.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_Link" href="http://www.cnblogs.com/sanshi/category/195954.html">qooxdoo(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_RssLink" title="Subscribe to qooxdoo(3)" href="http://www.cnblogs.com/sanshi/category/195954.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_Link" href="http://www.cnblogs.com/sanshi/category/192726.html">Rhino(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_RssLink" title="Subscribe to Rhino(3)" href="http://www.cnblogs.com/sanshi/category/192726.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_Link" href="http://www.cnblogs.com/sanshi/category/190358.html">Tools(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_RssLink" title="Subscribe to Tools(3)" href="http://www.cnblogs.com/sanshi/category/190358.html/rss">(rss)</a></li>

</ul>

</div>

<div class="catListPostArchive">
<h3 class="catListTitle">随笔档案</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/sanshi/archive/2010/01.html">2010年1月 (1)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/sanshi/archive/2009/12.html">2009年12月 (5)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/sanshi/archive/2009/11.html">2009年11月 (3)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl04_Link" href="http://www.cnblogs.com/sanshi/archive/2009/10.html">2009年10月 (1)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl05_Link" href="http://www.cnblogs.com/sanshi/archive/2009/09.html">2009年9月 (20)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl06_Link" href="http://www.cnblogs.com/sanshi/archive/2009/08.html">2009年8月 (22)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl07_Link" href="http://www.cnblogs.com/sanshi/archive/2009/07.html">2009年7月 (18)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl08_Link" href="http://www.cnblogs.com/sanshi/archive/2009/06.html">2009年6月 (26)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl09_Link" href="http://www.cnblogs.com/sanshi/archive/2009/05.html">2009年5月 (18)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl10_Link" href="http://www.cnblogs.com/sanshi/archive/2009/04.html">2009年4月 (1)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl11_Link" href="http://www.cnblogs.com/sanshi/archive/2009/02.html">2009年2月 (7)</a> </li>

</ul>

</div>



<div class="catListEssay">
<h3 class="catListTitle">最新随笔</h3>
<ul>
	
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl00_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2010/01/06/1640779.html">1.&nbsp;ExtAspNet v2.1.9</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl01_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/29/1635458.html">2.&nbsp;ExtAspNet技术交流群（QQ）</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl02_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/28/1634173.html">3.&nbsp;ExtAspNet logo 新鲜出炉</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl03_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/06/1617922.html">4.&nbsp;ExtAspNet v2.1.8</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl04_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/02/1615260.html">5.&nbsp;ExtAspNet v2.1.7 important patch</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl05_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/01/1614897.html">6.&nbsp;ExtAspNet v2.1.7</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl06_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/11/26/1611635.html">7.&nbsp;ExtAspNet v2.1.6</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl07_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/11/21/1607675.html">8.&nbsp;ExtAspNet v2.1.5</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl08_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/11/17/1604904.html">9.&nbsp;ExtAspNet v2.1.4</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl00_RecentPostsList_ctl09_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/10/19/1586192.html">10.&nbsp;ExtAspNet v2.1.3</a></li>
		
		
</ul>
</div>

<div class="catListBlogRank">
<h3 class="catListTitle">积分与排名</h3>
<ul>
	<li class="liScore">
		积分 -	163256
	</li><li class="liRank">
		排名 -	378
	</li>
</ul>
</div>



<div class="catListComment">
<h3 class="catListTitle">最新评论<a id="SingleColumn1__b99510_RSSHyperlink1" title="RSS订阅最最新评论" href="http://www.cnblogs.com/sanshi/CommentsRSS.aspx"><img title="RSS订阅最最新评论" src="xml.gif" style="border-width: 0px;"></a></h3>

	
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl00_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2010/01/06/1640779.html#1748418">1.&nbsp;Re:ExtAspNet v2.1.9</a>
			</div>
			<div class="divRecentComment">
				请问弹出窗口最小化怎么设置？？ (老贺的博客)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl01_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2010/01/06/1640779.html#1745728">2.&nbsp;Re:ExtAspNet v2.1.9</a>
			</div>
			<div class="divRecentComment">
				[quote]playsea：
关于前台调用后台方法的问题：
后台代码：
[AjaxPro.AjaxMethod]
        public DataSet getDepart(string ci... (sanshi)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl02_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2010/01/06/1640779.html#1745716">3.&nbsp;Re:ExtAspNet v2.1.9</a>
			</div>
			<div class="divRecentComment">
				关于前台调用后台方法的问题：
后台代码：
[AjaxPro.AjaxMethod]
        public DataSet getDepart(string cid)
        {
   ... (playsea)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl03_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2009/08/29/1556438.html#1743541">4.&nbsp;Re:基于Extjs的开源控件库 - http://extaspnet.codeplex.com/</a>
			</div>
			<div class="divRecentComment">
				大哥,什么时候能发一个 上传控件啊   急用啊!!!
大哥,什么时候能发一个 上传控件啊   急用啊!!!
大哥,什么时候能发一个 上传控件啊   急用啊!!!
大哥,什么时候能发一个 上传控件啊  ... (爱淘课啊)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl04_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2010/01/06/1640779.html#1743540">5.&nbsp;Re:ExtAspNet v2.1.9</a>
			</div>
			<div class="divRecentComment">
				大哥,什么时候能发一个 上传控件啊   急用啊!!!
大哥,什么时候能发一个 上传控件啊   急用啊!!!
大哥,什么时候能发一个 上传控件啊   急用啊!!!
大哥,什么时候能发一个 上传控件啊  ... (爱淘课啊)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl05_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2009/12/29/1635458.html#1739707">6.&nbsp;Re:ExtAspNet技术交流群（QQ）</a>
			</div>
			<div class="divRecentComment">
				老大,关于我提出的动态生成控件问题,什么时候可以支持,这个功能其实挺常用的 (温景良(Jason))
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl06_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2009/12/06/1617922.html#1739699">7.&nbsp;Re:ExtAspNet v2.1.8</a>
			</div>
			<div class="divRecentComment">
				多谢!!! (eroach)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl07_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2009/12/06/1617922.html#1739209">8.&nbsp;Re:ExtAspNet v2.1.8</a>
			</div>
			<div class="divRecentComment">
				@eroach
ME /FIREFOX/ 等 点击根菜单,弹出的部份都 不会遮住根菜单, 但是用EXTASPNET做的却遮住根菜单.
-----这个是BUG，已经在Codeplex的SVN中修正。 (sanshi)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl08_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2009/12/06/1617922.html#1738097">9.&nbsp;Re:ExtAspNet v2.1.8</a>
			</div>
			<div class="divRecentComment">
				[quote]sanshi：
MenuHyperLink有图标区域，但是不显示图标我觉得没问题哦，你看extjs的官方示例：

你说的生成PDF再打印是个好办法，你是怎么生成PDF的？[/quote]... (eroach)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__b99510_CommentList_ctl09_Hyperlink2" class="listitem" href="http://www.cnblogs.com/sanshi/archive/2009/08/29/1556438.html#1737904">10.&nbsp;Re:基于Extjs的开源控件库 - http://extaspnet.codeplex.com/</a>
			</div>
			<div class="divRecentComment">
				[quote]lihua好心情：
楼主您好～
有个问题请教一下，似乎拥有EnableCollapse属性的控件,如GroupPanel、Form，
若设置"EnableCollapse =t... (sanshi)
			</div>		
		
</div>

<div class="catListView">
<h3 class="catListTitle">阅读排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/07/14/1523634.html">1.&nbsp;ExtAspNet新版本发布，集成Extjs3.0，兼容IE浏览器(5652)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/07/07/1518318.html">2.&nbsp;基于Extjs的AspNet开源控件库 - ExtAspNet(5263)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/08/21/1551721.html">3.&nbsp;企业Web2.0项目开发必备 - http://code.google.com/p/jslint-toolkit/(3645)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/07/08/1519036.html">4.&nbsp;JavaScript继承详解(3434)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556677.html">5.&nbsp;JavaScript应用技巧集合(3300)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl06_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/07/17/1525926.html">6.&nbsp;ExtAspNet应用技巧（一）(2905)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl07_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/08/28/1555717.html">7.&nbsp;CST和GMT时间的区别(2780)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl08_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/08/10/1543049.html">8.&nbsp;ExtAspNet应用技巧（五） - 动态创建工具栏菜单(2727)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl09_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/08/30/1556913.html">9.&nbsp;ExtAspNet应用技巧（十二） - 系统登录(2701)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl10_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/09/08/1562860.html">10.&nbsp;ExtAspNet应用技巧（十三） - 后台主页面（IFrame框架）(2697)</a>
			</li>
		
			</ul>
		
</div>

<div class="catListView">
<h3 class="catListTitle">60天内阅读排行</h3>

			<ul>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/06/1617922.html">1.&nbsp;ExtAspNet v2.1.8(672)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/11/21/1607675.html">2.&nbsp;ExtAspNet v2.1.5(450)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/11/26/1611635.html">3.&nbsp;ExtAspNet v2.1.6(317)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/01/1614897.html">4.&nbsp;ExtAspNet v2.1.7(290)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/02/1615260.html">5.&nbsp;ExtAspNet v2.1.7 important patch(262)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl06_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2010/01/06/1640779.html">6.&nbsp;ExtAspNet v2.1.9(245)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl07_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/28/1634173.html">7.&nbsp;ExtAspNet logo 新鲜出炉(239)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__b38957_TopList_ctl08_Hyperlink1" href="http://www.cnblogs.com/sanshi/archive/2009/12/29/1635458.html">8.&nbsp;ExtAspNet技术交流群（QQ）(200)</a>
			</li>
		
			</ul>
		
</div>
			</div>
			
		</div><!--end: sideBarMain -->
	</div><!--end: sideBar 侧边栏容器 -->
	<div class="clear"></div>
	</div><!--end: main -->
	<div class="clear"></div>
	<div id="footer">
		
<!--done-->
Copyright ©2010 三生石上
	</div><!--end: footer -->
</div><!--end: home 自定义的最大容器 -->
    </form>
	
	
      
    
    
    
</body></html>
